package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CoachesMapper;
import com.ruoyi.system.domain.Coaches;
import com.ruoyi.system.service.ICoachesService;

/**
 * 教练信息Service业务层处理
 * 
 * @author 张英旺
 * @date 2024-02-21
 */
@Service
public class CoachesServiceImpl implements ICoachesService 
{
    @Autowired
    private CoachesMapper coachesMapper;

    /**
     * 查询教练信息
     * 
     * @param coachId 教练信息主键
     * @return 教练信息
     */
    @Override
    public Coaches selectCoachesByCoachId(Long coachId)
    {
        return coachesMapper.selectCoachesByCoachId(coachId);
    }

    /**
     * 查询教练信息列表
     * 
     * @param coaches 教练信息
     * @return 教练信息
     */
    @Override
    public List<Coaches> selectCoachesList(Coaches coaches)
    {
        return coachesMapper.selectCoachesList(coaches);
    }

    /**
     * 新增教练信息
     * 
     * @param coaches 教练信息
     * @return 结果
     */
    @Override
    public int insertCoaches(Coaches coaches)
    {
        coaches.setCreateTime(DateUtils.getNowDate());
        return coachesMapper.insertCoaches(coaches);
    }

    /**
     * 修改教练信息
     * 
     * @param coaches 教练信息
     * @return 结果
     */
    @Override
    public int updateCoaches(Coaches coaches)
    {
        coaches.setUpdateTime(DateUtils.getNowDate());
        return coachesMapper.updateCoaches(coaches);
    }

    /**
     * 批量删除教练信息
     * 
     * @param coachIds 需要删除的教练信息主键
     * @return 结果
     */
    @Override
    public int deleteCoachesByCoachIds(Long[] coachIds)
    {
        return coachesMapper.deleteCoachesByCoachIds(coachIds);
    }

    /**
     * 删除教练信息信息
     * 
     * @param coachId 教练信息主键
     * @return 结果
     */
    @Override
    public int deleteCoachesByCoachId(Long coachId)
    {
        return coachesMapper.deleteCoachesByCoachId(coachId);
    }
}
